/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thinkinginjava.svn.reflection.nullobjects;

import java.lang.reflect.Proxy;

/**
 *
 * @author public_enemy
 */
public class NullRobot {

    public static Robot newNullRobot(Class<? extends Robot> type) {
        return (Robot) Proxy.newProxyInstance(NullRobot.class.getClassLoader(), new Class[]{Null.class, Robot.class}, new NullRobotProxyhandler(type));
    }

    public static void main(String[] args) {
        Robot[] bots = {
            new SnowRemovalRobot("SnowBee"), newNullRobot(SnowRemovalRobot.class)};
        for (Robot bot : bots) {
            Robot.Test.test(bot);
        }
    }
}
